﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
    <Style x:Key="HyperButton" TargetType="HyperlinkButton">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled"/>
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Unfocused"/>
                                <vsm:VisualState x:Name="Focused"/>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="Content" Opacity="0.75"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ButtonStyle" TargetType="Button">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="MainGrid" Opacity="1">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="BackLight" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation To="0.5" Duration="0" Storyboard.TargetName="MainGrid" Storyboard.TargetProperty="Opacity"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="BackLight" Storyboard.TargetProperty="Opacity"/>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Translation" Storyboard.TargetProperty="X"/>
                                        <DoubleAnimation To="1" Duration="0" Storyboard.TargetName="Translation" Storyboard.TargetProperty="Y"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Unfocused"/>
                                <vsm:VisualState x:Name="Focused"/>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="5" MaxWidth="5" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="5" MaxWidth="5" />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="10"/>
                            <RowDefinition MinHeight="10"/>
                        </Grid.RowDefinitions>

                        <Grid.RenderTransform >
                            <TranslateTransform x:Name="Translation"/>
                        </Grid.RenderTransform>

                        <Rectangle Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" RadiusX="10" RadiusY="10" Fill="Black"/>

                        <Rectangle Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" x:Name="BackLight" RadiusX="10" RadiusY="10" Opacity="0" Fill="Green"/>

                        <Rectangle Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" RadiusX="10" RadiusY="10">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                                    <GradientStop Offset="0" Color="#3F00FF00"/>
                                    <GradientStop Offset="1" Color="#FF00FF00"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <Rectangle Grid.Column="1" Grid.Row="0" RadiusX="5" RadiusY="5">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                                    <GradientStop Offset="0" Color="#BFFFFFFF"/>
                                    <GradientStop Offset="1" Color="#00FFFFFF"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>

                        <ContentPresenter Margin="0,0,0,2" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" 
                                VerticalAlignment="Center" HorizontalAlignment="Center"
                                Content="{TemplateBinding Content}" />

                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
